<?php if (!defined('THINK_PATH')) exit();?><!-- <!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>用户列表</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no">

  <link rel="stylesheet" href="/Public/layui-demo/layui-v2.5.6/css/layui.css">

</head>

<body style="padding: 10px;">

  <table class="layui-table">
    <colgroup>
      <col width="150">
      <col width="200">
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>序号</th>
        <th>用户名</th>
        <th>上次登录时间</th>
        <th>上次登录时间</th>
        <th>所属用户组</th>
      </tr>
    </thead>
    <tbody>
      <?php if(is_array($user)): $i = 0; $__LIST__ = $user;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vol): $mod = ($i % 2 );++$i;?><tr>
          <td><?php echo ($vol["id"]); ?></td>
          <td><?php echo ($vol["username"]); ?></td>
          <td><?php echo (date('Y-m-d H:i:s',$vol["logintime"])); ?></td>
          <td><?php echo ($vol["loginip"]); ?></td>
          <td><?php echo ($vol['role'][0]['name']); ?></td>
        </tr><?php endforeach; endif; else: echo "" ;endif; ?>


    </tbody>
  </table>

  <br><br><br>


  <script src="/Public/layui-demo/layui-v2.5.6/layui.js"></script>
  <script>
    layui.use(['form'], function () {
      var form = layui.form
    })
  </script>

</body>

</html> -->

<!-- <html>

<head>
  <meta charset="utf-8">
  <title></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/Public/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/Public/style/admin.css" media="all">
  <link id="layuicss-layer" rel="stylesheet"
    href="https://www.layui.com/admin/std/dist/layuiadmin/layui/css/modules/layer/default/layer.css?v=3.1.1"
    media="all">
  <style id="LAY_layadmin_theme">
    .layui-side-menu,
    .layadmin-pagetabs .layui-tab-title li:after,
    .layadmin-pagetabs .layui-tab-title li.layui-this:after,
    .layui-layer-admin .layui-layer-title,
    .layadmin-side-shrink .layui-side-menu .layui-nav>.layui-nav-item>.layui-nav-child {
      background-color: #20222A !important;
    }

    .layui-nav-tree .layui-this,
    .layui-nav-tree .layui-this>a,
    .layui-nav-tree .layui-nav-child dd.layui-this,
    .layui-nav-tree .layui-nav-child dd.layui-this a {
      background-color: #009688 !important;
    }

    .layui-layout-admin .layui-logo {
      background-color: #20222A !important;
    }
  </style>
</head>

<body layadmin-themealias="default">
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">用户列表</div>
          <div class="layui-card-body">

            <div class="layui-table-box">
              <table class="layui-table">
                <colgroup>
                  <col width="150">
                  <col width="200">
                  <col>
                </colgroup>
                <thead>
                  <tr>
                    <th>序号</th>
                    <th>用户名</th>
                    <th>上次登录时间</th>
                    <th>上次登录时间</th>
                    <th>所属用户组</th>
                  </tr>
                </thead>
                <tbody>
                  <?php if(is_array($user)): $i = 0; $__LIST__ = $user;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vol): $mod = ($i % 2 );++$i;?><tr>
                      <td><?php echo ($vol["id"]); ?></td>
                      <td><?php echo ($vol["username"]); ?></td>
                      <td><?php echo (date('Y-m-d H:i:s',$vol["logintime"])); ?></td>
                      <td><?php echo ($vol["loginip"]); ?></td>
                      <td><?php echo ($vol['role'][0]['name']); ?></td>
                    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                </tbody>
              </table>
            </div>
          </div>

        </div>
      </div>
    </div>
  </div>

  <script src="/Public/layui/layui.js"></script>
  <script>
    layui.use(['index', 'table', 'form'], function () {
      var table = layui.table
    });
  </script>
</body>

</html> -->



<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/Public/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/Public/style/admin.css" media="all">
  <link id="layuicss-layer" rel="stylesheet"
    href="https://www.layui.com/admin/std/dist/layuiadmin/layui/css/modules/layer/default/layer.css?v=3.1.1"
    media="all">
</head>

<body>

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">用户列表</div>
          <div class="layui-card-body">
            <table class="layui-hide" id="role-table-toolbar" lay-filter="role-table-toolbar"></table>
          </div>
        </div>
      </div>
    </div>
  </div>


  <script src="/Public/layui/layui.js"></script>
  <script>
    layui.config({
      base: '/Public/' //静态资源所在路径
    }).extend({
      index: 'lib/index' //主入口模块
    }).use(['index', 'table', 'form'], function () {
      var $ = layui.$
        , admin = layui.admin
        , table = layui.table
        , form = layui.form
        , util = layui.util;
      table.render({
        elem: '#role-table-toolbar'
        , url: '<?php echo U('Rbac/userListApi');?>'
        , toolbar: '#role-table-toolbar-add'
        , title: ''
        , cols: [[
          { type: 'checkbox', fixed: 'left' }
          , { field: 'id', title: '序号', sort: true }
          , { field: 'username',  title: '用户名称' }
          , { field: 'logintime', title: '上次登录时间', sort: true, templet: function (d) { return util.toDateString(d.end_times * 1000, "yyyy-MM-dd HH:mm:ss"); } }
          , { field: 'loginip',  title: '上次登录IP' }
          , { field: 'name',  title: '所属用户组' ,templet: function (d) { return d.role[0].name; } }
        ]]
        , page: true
    });


  });
  </script>
</body>

</html>